Change media player
This demonstrates loading an empty entry and then calling the changeMedia API to load different entry
Add changeMedia call for all changeMedia buttons :
kWidget.addReadyCallback(function(playerId){
$( '.changeMedia' ).click(function(){
kdp.sendNotification( "changeMedia", { 'entryId' : $(this).attr('data-entryId') });
});
});
Listening to change media events:
kWidget.addReadyCallback(function(playerId){
var kdp = document.getElementById( videoId );
kdp.kBind('changeMedia', function(data){
$("#changeLog").append( "EntryId: " + data.entryId + " name:" +
kdp.evaluate('{mediaProxy.entry.name}') + "\n" );
;
})
});
Change Media Log:
Note: this player is empty until you change media to an active entry: